#pragma once
#include "IVFileManager.h"
#include "list"
#include "string"

namespace OS
{
	typedef void *FILE;

	class COSFile
		:public IOSFile
	{
	public:
		COSFile(FILE handle);
		virtual ~COSFile(void);
		virtual bool Read(void *buffer, unsigned int readlen);
		virtual bool Write(void *buffer, unsigned int writelen);
		virtual void Seek(__int64 offset, FILEPOS origin);
		virtual __int64 GetLength();
		virtual void Close();

	private:
		FILE m_handle;
	};

	IOSFile* OpenFile(const char *filename, OpenMode mode);

	void GetDirectoryFiles(const char *dir, std::list<std::string> &files, const char *prefix = NULL);
	void makedir(const char *dir);

}